import java.lang.reflect.Array;

public class Test1 {
    public static void main (String[] args) throws CloneNotSupportedException {
        Student student1 = new Student(10,"zs");
        Student student2 = new Student(20,"ls");
        NameCompartor nameCompartor = new NameCompartor();
        //姓名比较器
        int ret = nameCompartor.compare(student1,student2);
        //克隆
        Student student = new Student();
        student = (Student) student1.clone();
        System.out.println(student);
        int n = 0;


    }
}

class Student implements Comparable<Student>,Cloneable{
    private int age;
    public String name;

    public Student(int age, String name) {
        this.age = age;
        this.name = name;
    }
    public Student() {
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}